]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnail: always destroy bgManager when destroyed
authorRay Strode <rstrode@redhat.com>
Mon, 25 Mar 2013 15:31:56 +0000 (11:31 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 26 Mar 2013 21:02:05 +0000 (17:02 -0400)
Right now we only destroy the bgManager object when the
workspaceThumbnail is explicitly destroy with its destroy()
method.

This commit makes sure bgManager gets destroyed when the
workspaceThumbnail actor is destroyed without calling
destroy().

https://bugzilla.gnome.org/show_bug.cgi?id=696157

js/ui/workspaceThumbnail.js

index 689ded0355390e651220df582613d6d5f2ed0319..6b631d1d96e42f6190d214dc6dfb9072742035d8 100644 (file)
@@ -384,9 +384,8 @@ const WorkspaceThumbnail = new Lang.Class({
     },
 
     destroy : function() {
-        this.actor.destroy();
-        this._bgManager.destroy();
-        this._bgManager = null;
+        if (this.actor)
+          this.actor.destroy();
     },
 
     workspaceRemoved : function() {
@@ -407,6 +406,11 @@ const WorkspaceThumbnail = new Lang.Class({
     _onDestroy: function(actor) {
         this.workspaceRemoved();
 
+        if (this._bgManager) {
+          this._bgManager.destroy();
+          this._bgManager = null;
+        }
+
         this._windows = [];
         this.actor = null;
     },